<?php

namespace App\Providers;


use App\Http\observer\ActiveObserver;
use App\Http\observer\AroundEnvironmentObserve;
use App\Http\observer\BannersObserver;
use App\Http\observer\BindGoodsObserver;
use App\Http\observer\ChartLogObserver;
use App\Http\observer\ChickenObserver;
use App\Http\observer\CouponLogObserve;
use App\Http\observer\CustomObserver;
use App\Http\observer\CustomThroughObserve;
use App\Http\observer\EggLogObserver;
use App\Http\observer\FloorObserver;
use App\Http\observer\GoodsOrderObserver;
use App\Http\observer\HomeSetObserver;
use App\Http\observer\HouseObserver;
use App\Http\observer\ImageObserver;
use App\Http\observer\PropertyObserver;
use App\Http\observer\StarLogObserver;
use App\Http\observer\TurntableActiveObserver;
use App\Http\observer\TurntableLogObserver;
use App\Http\observer\UserObserver;
use App\Models\Active;
use App\Models\AroundEnvironment;
use App\Models\Banner;
use App\Models\BindGood;
use App\Models\ChartLog;
use App\Models\Chicken;
use App\Models\CouponLog;
use App\Models\Custom;
use App\Models\CustomThrough;
use App\Models\EggLog;
use App\Models\Floor;
use App\Models\GoodsOrder;
use App\Models\HomeSet;
use App\Models\House;
use App\Models\Image;
use App\Models\Property;
use App\Models\StarLog;
use App\Models\TurntableActive;
use App\Models\TurntableLog;
use App\Models\User;
use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Database\Events\StatementPrepared;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array<class-string, array<int, class-string>>
     */
    protected $listen = [
        Registered::class => [
           // SendEmailVerificationNotification::class,
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        Property::observe(PropertyObserver::class);
        Floor::observe(FloorObserver::class);
        Custom::observe(CustomObserver::class);
        House::observe(HouseObserver::class);
        User::observe(UserObserver::class);
        HomeSet::observe(HomeSetObserver::class);
        StarLog::observe(StarLogObserver::class);
        Chicken::observe(ChickenObserver::class);
        EggLog::observe(EggLogObserver::class);
        Image::observe(ImageObserver::class);
        Active::observe(ActiveObserver::class);
        TurntableLog::observe(TurntableLogObserver::class);
        AroundEnvironment::observe(AroundEnvironmentObserve::class);
        Banner::observe(BannersObserver::class);
        ChartLog::observe(ChartLogObserver::class);
        TurntableActive::observe(TurntableActiveObserver::class);
        BindGood::observe(BindGoodsObserver::class);
        CouponLog::observe(CouponLogObserve::class);
        GoodsOrder::observe(GoodsOrderObserver::class);
        CustomThrough::observe(CustomThroughObserve::class);

        Event::listen(StatementPrepared::class, function ($event) {
            $event->statement->setFetchMode(\PDO::FETCH_ASSOC);
        });
    }
}
